<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="../vue.js"></script>
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <ul>
        <li>商品名称--商品价格--商品数量</li>
        <li v-for="(item,index) in list" :key="index">
          <input type="checkbox" />
          {{item.name}}--{{item.price}}--
          <button @click="del">-</button>
          {{item.num}}
          <button @click="add">+</button>
        </li>
      </ul>
      <div>总价{{total}}，已选择{{sum}}件商品</div>
    </div>
    <script>
      var app = new Vue({
        el: "#app",
        data: {
          list: [
            { name: "iphonex", price: 999.88, num: 10 },
            { name: "iphone14pro", price: 8999.75, num: 8 },
            { name: "iphone6", price: 1323.15, num: 6 },
          ],
        },
        methods: {
          add() {},
          del() {},
        },


       
      });
    </script>
  </body>
</html>
